CREATE TABLE [dbo].[TTCORR_DOPR]
(
[CO_EMPR] [dbo].[TD_VC_002] NOT NULL,
[NU_ANNO] [dbo].[TD_IN_004_ANOS] NOT NULL,
[NU_MESE] [dbo].[TD_IN_002_MESE] NOT NULL,
[NU_CORR] [dbo].[TD_IN_001] NOT NULL CONSTRAINT [DF__TTCORR_DO__NU_CO__0015E5C7] DEFAULT ((0)),
[CO_USUA_CREA] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TTCORR_DO__CO_US__010A0A00] DEFAULT (suser_sname()),
[FE_USUA_CREA] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TTCORR_DO__FE_US__01FE2E39] DEFAULT (getdate()),
[CO_USUA_MODI] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TTCORR_DO__CO_US__02F25272] DEFAULT (suser_sname()),
[FE_USUA_MODI] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TTCORR_DO__FE_US__03E676AB] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TTCORR_DOPR] WITH NOCHECK ADD CONSTRAINT [CK__TTCORR_DO__NU_AN__7E2D9D55] CHECK NOT FOR REPLICATION (([NU_ANNO]>(1980)))
GO
ALTER TABLE [dbo].[TTCORR_DOPR] WITH NOCHECK ADD CONSTRAINT [CK__TTCORR_DO__NU_ME__7F21C18E] CHECK NOT FOR REPLICATION (([NU_MESE]>=(0) AND [NU_MESE]<=(13)))
GO
ALTER TABLE [dbo].[TTCORR_DOPR] ADD CONSTRAINT [PK__TTCORR_D__DCCF5D1D123F82FA] PRIMARY KEY CLUSTERED  ([CO_EMPR], [NU_ANNO], [NU_MESE]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TTCORR_DOPR] ADD CONSTRAINT [FK__TTCORR_DO__CO_EM__4EA972BC] FOREIGN KEY ([CO_EMPR]) REFERENCES [dbo].[TMPARA_TESO] ([CO_EMPR])
GO
